
# celery的任务[函数] 必须要让celery市里的 task装饰器装饰
# celery的任务[函数] 需要让celery检测到

from celery_meiduo.main import app
from ronglian_sms_sdk import SmsSDK

@app.task
def celery_send_sms_code(mobile, sms_code, time):


    sdk = SmsSDK(accId, accToken, appId)

    # 调用发送短信的方法
    tid = '1'  # 只能用模板为 1
    mobile = '{}'.format(mobile)
    datas = (sms_code, time)
    sdk.sendMessage(tid, mobile, datas)